#include <stdio.h>
#include "func_file.h"
#define MAX 64
int main(int argc, char const *argv[])
{
    char ch1[MAX] = "wangxingxing";
    char ch2[MAX] = "zuishuai";
    printf("ch1=%s\n", ch1);
    printf("ch2=%s\n", ch2);
    my_strcat(ch1, ch2); // strcpy的实现
    printf("my_strcat(ch1,ch2)=%s\n", ch1);

    char *p = my_strchr(ch1, 'x');
    printf("\nch1=%s\n", ch1);
    printf("my_strchr(ch1,'x')=%s\n", p);

    char ch3[MAX] = "wangxingxingbushuai";
    char ch4[MAX] = "wangxingxingshuai";
    printf("\nch3=%s\tch4=%s\n", ch3, ch4);
    printf("my_strcmp(ch3,ch4)=%d\n", my_strcmp(ch3, ch4));

    printf("\nch1=%s\n", ch1);
    printf("my_strlen(ch1)=%ld\n", my_strlen(ch1));

    printf("\nch1=%s\tch2=%s\n", ch1, ch2);
    my_strcpy(ch1, ch2);
    printf("my_strcpy(ch1,ch2)=%s\n", ch1);

    char *ch5 = "xing";
    printf("\nch4=%s\tch5=%s\n", ch4, ch5);
    if (my_strstr(ch4, ch5) == NULL)
        printf("ch4,ch5匹配失败\n");
    else
        printf("my_strstr(ch4,ch5)=%s\n", my_strstr(ch4, ch5));
    return 0;
}
